﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace WcfFlashRemoting.AmfObjects
{
    [Serializable]
    class NamedDictionary : ISerializable
    {
        public NamedDictionary()
        {
            Properties = new Dictionary<string, object>();
        }

        public string TypeName { get; set; }
        public Dictionary<string, object> Properties { get; private set; }

        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("TypeName", TypeName);
            foreach (var kvp in Properties)
            {
                info.AddValue(kvp.Key, kvp.Value);
            }
        }
    }
}
